<?php
	('Access-Control-Allow-Origin：*');
	include("../config/mysql.php");
	$db = new mysql();
	$password = $_POST["password"];
	$num = $_POST["num"];
	$company_id = $_POST["company_id"];
	
	$count = $db->getResultNum("select * from examaccount");
	if ($num > 0) {
		for ($i = 0; $i < $num; $i++) {
			$count = strval($count);
			$account = $_POST["account"];
			$account = $account.=$count;
			$sql = "INSERT INTO examaccount (account,`password`,company_id) VALUE ('{$account}','{$password}',{$company_id})";
			$count = intval($count);
			$count++;
			$db->Query($sql);
		}
		echo 1;
	}else{
		$account = $_POST["account"];
		$sql = "INSERT INTO examaccount (account,`password`,company_id) VALUE ('{$account}','{$password}',{$company_id})";
		echo $db->Query($sql);
	}
	$db->close();
